home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / IVM.ZIP / ROUTINES / SCREWCOM.RTN < prev   
Text File  |  1992-12-25  |  648b  |  15 lines

  1. ;  This swaps two com ports.
  2. ;  BX=First com port.
  3. ;  SI=Second Com Port.
  4.  
  5.         push    es                      ; Save ES
  6.         xor     ax,ax                   ; Set the extra segment to
  7.         mov     es,ax                   ; zero (ROM BIOS)
  8.         shl     bx,1                    ; Convert to word index
  9.         shl     si,1                    ; Convert to word index
  10.         mov     ax,word ptr [bx + 03FEh]; Zero COM port address
  11.         xchg    word ptr [si + 03FEh],ax; Put first value in second,
  12.         mov     word ptr [bx + 03FEh],ax; and second value in first!
  13.         pop     es                      ; Restore ES
  14.  
  15.